<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>拼团添加</title>
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
</head>
<body>

<div class="layuimini-container">
    <form action="/admin/store.PinkConfig/pinkAddSave" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>商品图片：</label>
            <div class="layui-input-block">
                <img width="100px" height="100px" src="{$goods_info.image}" alt="">
                <input type="hidden" name="goods_img" class="layui-input" lay-verify="required" placeholder="请输入商品图片"
                       value="{$goods_info.image}">
            </div>
        </div>
        <!--        隐藏商品名称 入库-->
        <input type="hidden" name="goods_name" value="{$goods_info.goods_name}" lay-verify="required">
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>商品轮播图：</label>
            <div class="layui-input-block">
                {foreach $goods_info['goods_carousel'] as $item}
                <img width="100px" height="100px" src="{$item}" alt="">
                <input type="hidden" name="goods_carouse[]" value="{$item}">
                {/foreach}

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>拼团名称</label>
            <div class="layui-input-block">
                <input type="text" name="pink_name" class="layui-input" lay-verify="required" placeholder="请输入拼团活动名称"
                       value="【现货发顺丰 6期免息】vivo X60 5G新品拍照智能手机5nm旗舰芯片蔡司光学镜头官方旗舰店官网正品限量纪念版】">

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>拼团简介</label>
            <div class="layui-input-block">
                <input type="text" name="pink_desc" class="layui-input" lay-verify="required" placeholder="请输入拼团简介"
                       value="【现货发顺丰 6期免息】vivo X60 5G新品拍照智能手机5nm旗舰芯片蔡司光学镜头官方旗舰店官网正品限量纪念版">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>单位</label>
            <div class="layui-input-block">
                <input type="number" name="pink_unit" class="layui-input" lay-verify="required" placeholder="件"
                       value="1">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>活动日期</label>
            <div class="layui-input-inline">
                <input type="text" name="pink_time" value="2021-08-31 03:03:02 到 2021-09-01 02:02:02"
                       class="layui-input"
                       id="test16" placeholder="开始 到 结束" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>活动有效期 [小时]</label>
            <div class="layui-input-block">
                <input type="number" name="validity_time" class="layui-input" lay-verify="required"
                       placeholder="请输入拼团时间限制"
                       max="24" min="1" value="2">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>拼团人数</label>
            <div class="layui-input-block">
                <input type="number" name="pink_people" class="layui-input" lay-verify="required"
                       placeholder="请输入拼团人数限制"
                       value="4">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>拼团购买数量（限制</label>
            <div class="layui-input-block">
                <input type="number" name="pink_pay_num" class="layui-input" lay-verify="required"
                       placeholder="请输入拼团购买数量（限制)" value="1">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" name="sort" class="layui-input" placeholder="请输入排序"
                       value="25">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>拼团活动状态</label>
            <div class="layui-input-block">
                <input type="radio" name="pink_status" value="0" checked>开启
                <input type="radio" name="pink_status" value="1">关闭
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>运费模板id</label>
            <div class="layui-input-block">
                <select name="freight_id" id="">
                    <option value="0">请选择</option>
                    {foreach $freight as $item}
                    <option value="{$item.id}">{$item.template_name}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><span class="x-red">*</span>商品属性</label>
            <div class="layui-input-block">
                <table class="layui-table">
                    <tr>
                        <th>选择</th>
                        <th>颜色</th>
                        <th>套餐类型</th>
                        <th>存储容量</th>
                        <th>版本类型</th>
                        <th>图片</th>
                        <th><span class="x-red">*</span>拼团价</th>
                        <th>原价</th>
                        <th>库存</th>
                        <th><span class="x-red">*</span>限量</th>
                        <th>重量</th>
                        <th>体积</th>
                        <th>商品编号</th>
                    </tr>
                    {foreach $goods_info['sku'] as $item}
                    <tr>
                        <td>
                            <input type="checkbox" value="{$item.id}" name="goods_sku_id">
                        </td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td>{$item.attr_values}</td>
                        <td><img width="50px" height="50px" src="{$item.sku_image}" alt=""></td>
                        <td>
                            <input type="number" name="pink_price" class="layui-input" lay-verify="required"
                                   placeholder="请输入拼团价"
                                   value="25.00" min="0.00" max="9999999999999.00" step="0.01">
                        </td>
                        <td>
                            <!--原价-->
                            <input type="number" name="goods_sku_price" readonly="readonly" class="layui-input"
                                   min="0.00" max="9999999999999.00" step="0.01"
                                   value="{$item.sku_price}">
                        </td>
                        <td>{$item.sku_stock}</td>
                        <td>
                            <input type="number" name="pink_sku_stock" class="layui-input" lay-verify="required"
                                   placeholder="活动库存"
                                   max="{$item.sku_stock}" min="1"
                                   value="25">
                        </td>
                        <td>{$item.sku_weight}</td>
                        <td>{$item.sku_volume}</td>
                        <td></td>
                    </tr>
                    {/foreach}
                </table>
            </div>
        </div>
        <div class="hr-line"></div>
        <div class="layui-form-item text-center">
            <input class="layui-btn" type="submit" value="提交">
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
        </div>
    </form>
</div>

</body>
</html>
<!-- 引入 layui.js -->
<script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
<script>
    layui.use(['laydate', 'form', 'layer', 'jquery'], function () {
        var laydate = layui.laydate,
            form = layui.form,
            layer = layui.layer,
            jquery = layui.jquery;

        //执行一个laydate实例
        laydate.render({
            elem: '#test16'
            , type: 'datetime'
            , range: '到'
            , format: 'yyyy-MM-dd HH:mm:ss'
        });
    })
</script>